< previous page page_201 next page >

Page 201
The filter used in Figure 7.6 has the following coefficients.
1
1
1
1
2
1
1
1
1

The positive coefficients indicate the direction in which edges are detected. In this kernel, the positive entries are in the upper left corner of the kernel. The resulting image highlights edges where colors change from light to dark while moving from the upper left to the lower right. Program Filter defines similar kernels for Prewitt edge detection in other directions.
Note that the coefficients in this kernel add to zero. In areas with little color variation, applying the coefficients to the pixels gives a value near zero, so output pixels are black. The output image has bright pixels only in areas where pixel colors change quickly and in the appropriate direction.
Laplacian Edge Detection
The Laplacian edge detection method uses a symmetric kernel to detect edges in all directions at the same time. Laplacian edge detection kernels are similar to those of high-pass filters, except the sum of the coefficients is zero rather than 1. This makes the values of most output pixels black, and places where the filter detects a high-frequency feature are brighter. Figure 7.7 shows program Filter using a Laplacian edge detection filter.
0201-01.jpg
Figure 7.7
Laplacian filters detect edges in all directions.

 
< previous page page_201 next page >